﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="//cdn.bootcss.com/jquery/3.1.0/jquery.min.js"></script>

    <script>
        function check()
        {
            return $("#num2").val()>$("#num1").val();           
        }
        $(function(){
            console.log(1);
        });
        console.log(2);
    </script>
</head>

<body>

    <form action="">
        姓名：<input type="text" name="name" required="required" oninput="" oninvalid="setCustomValidity('必须输入姓名')"><br/> 年龄：
        <input type="number" required="required" name="age"><br/> Email:
        <input type="email" name="email"></input><br/> 级别： <input type="range" min=1 max=10 name="range"><br/>
        <button>提交</button>
    </form>
    <form onsubmit="return check()">
        <input type="text" id="num1" name="num1">
        <input type="text" id="num2" name="num2">
        <input type="submit">
    </form>
</body>
</html>